﻿using Logistics.examination;
using Microsoft.AspNetCore.Mvc;

namespace Logistics.Web.Controllers
{
    public class examinationController : Controller
    {
        private readonly IApprovalactivityAppService _VehicleAppService;
        public examinationController(IApprovalactivityAppService VehicleAppService)
        {
            _VehicleAppService = VehicleAppService;
        }
        public IActionResult Index()
        {
            return View();
        }
        /// <summary>
        /// 显示
        /// </summary>
        /// <param name="page"></param>
        /// <param name="limit"></param>
        /// <returns></returns>
        public IActionResult GetFieldList(int page = 1, int limit = 3)
        {


            var getFoodListDto = new GetApprovalActivityDto
            {
                SkipCount = (page - 1) * limit,
                MaxResultCount = limit,
                Sorting = "Id desc"
            };
            var foods = _VehicleAppService.GetListAsync(getFoodListDto).Result;
            return Ok(new { data = foods.Items, count = foods.TotalCount, code = "0", msg = "" });

        }
        public IActionResult Edit(int Id, int Tid,int Nid,int Did)
        {
            ViewBag.Id = Id;
            ViewBag.Tid = Tid;
            ViewBag.NId = Nid;
            ViewBag.DId = Did;
            return View();
        }
        public IActionResult Updates(int id,int TId,int Did,int AuditStatus, string AuditProposal)
        {
            var q = _VehicleAppService.UpdateA(id, TId, Did, AuditStatus, AuditProposal).Result;
            return Ok(q);
        }
        public IActionResult UpdateB(int id, int AuditStatus, string AuditProposal)
        {
            var q = _VehicleAppService.UpdateB(id,  AuditStatus, AuditProposal).Result;
            return Ok(q);
        }
       
    }
}
